package models

type KyappSchool struct {
	Id         int    `xorm:"not null pk autoincr comment('自增主键') INT(11)"`
	SchoolId   int    `xorm:"index INT(10)"`
	KySchoolId int    `xorm:"comment('创建者id，user_id外键关联dts_user中的id') index INT(11)"`
	Token      string `xorm:"default '' comment('') VARCHAR(255)"`
	Isused     string `xorm:"default '' comment('') VARCHAR(128)"`
}

func (k *KyappSchool) GetBySchoolId(schoolId int) (has bool, list KyappSchool, err error) {
	has, err = engine.Table("dts_kyapp_school").
		Where("school_id = ?", schoolId).
		Get(&list)
	return
}

func (k *KyappSchool) GetKyBySchoolId(schoolId int) (has bool, list KyappSchool, err error) {
	has, err = engine.Table("dts_kyapp_school").
		Where("ky_school_id = ?", schoolId).
		Get(&list)
	return
}
